import { get, post } from '@/utils/request'

const prefix = 'express'

export default {
  /**
   * 物流公司列表
   */
  company: data => {
    return get(`${prefix}/company/index`, data)
  },

  /**
   * 物流轨迹信息
   */
  traces: data => {
    return get(`${prefix}/logistics/index`, data)
  },

  /**
   * 编辑地址信息
   */
  address: usage => {
    return get(`${prefix}/address/dropdown?usage=${usage}`)
  },

  /**
   * 编辑地址信息
   */
  updateAddress: (data, id, postMethod = true) => {
    if (postMethod) {
      return post(`${prefix}/address/update?id=${id}`, data)
    } else {
      return get(`${prefix}/address/update?id=${id}`)
    }
  }
}
